CloudFormationのリソースが最大数の200あるとき、n個削除してn個追加が成功するのか試してみた
CloudFormationには、1スタック内のリソース最大数が200という制限があります。
そこでふと気になりました。
「リソース数が200の状態で、n個削除してn個追加するのは成功するのか?」と。試してみました。
結果
成功しました。
- Lambdaを1つデプロイする(リソース数:0→4)
- 限界までSNSトピックをデプロイする(リソース数:4→200)
- 既存のLambdaを削除して新しいLambdaをデプロイする(リソース数:200→200)
やってみた
Lambdaを1つデプロイする
まずはAWS SAMプロジェクトを作成します。
sam init --runtime python3.7 --name test-resource-200
次のtemplate.yaml
を作成します。
AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: test-resource-200 Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello_world/ Handler: app.lambda_handler Runtime: python3.7 Events: HelloWorld: Type: Schedule Properties: Schedule: cron(0 0 * * ? *)
続いてデプロイします。
$ sam build $ sam package \ --output-template-file packaged.yaml \ --s3-bucket cm-fujii.genki-sam-test-bucket $ sam deploy \ --template-file packaged.yaml \ --stack-name Test-Resource-200-Stack \ --capabilities CAPABILITY_NAMED_IAM \ --no-fail-on-empty-changeset
リソースが4つできました。
- AWS::Lambda::Function
- AWS::Events::Rule
- AWS::Lambda::Permission
- AWS::IAM::Role
限界までSNSトピックをデプロイする
196個のSNSトピックを追加しました。これでリソースの合計は200です。
長いので折りたたみます
AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: test-resource-200 Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello_world/ Handler: app.lambda_handler Runtime: python3.7 Events: HelloWorld: Type: Schedule Properties: Schedule: cron(0 0 * * ? *) ResourceTestSnsTopic001: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-001 ResourceTestSnsTopic002: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-002 ResourceTestSnsTopic003: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-003 ResourceTestSnsTopic004: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-004 ResourceTestSnsTopic005: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-005 ResourceTestSnsTopic006: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-006 ResourceTestSnsTopic007: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-007 ResourceTestSnsTopic008: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-008 ResourceTestSnsTopic009: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-009 ResourceTestSnsTopic010: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-010 ResourceTestSnsTopic011: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-011 ResourceTestSnsTopic012: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-012 ResourceTestSnsTopic013: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-013 ResourceTestSnsTopic014: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-014 ResourceTestSnsTopic015: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-015 ResourceTestSnsTopic016: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-016 ResourceTestSnsTopic017: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-017 ResourceTestSnsTopic018: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-018 ResourceTestSnsTopic019: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-019 ResourceTestSnsTopic020: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-020 ResourceTestSnsTopic021: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-021 ResourceTestSnsTopic022: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-022 ResourceTestSnsTopic023: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-023 ResourceTestSnsTopic024: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-024 ResourceTestSnsTopic025: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-025 ResourceTestSnsTopic026: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-026 ResourceTestSnsTopic027: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-027 ResourceTestSnsTopic028: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-028 ResourceTestSnsTopic029: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-029 ResourceTestSnsTopic030: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-030 ResourceTestSnsTopic031: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-031 ResourceTestSnsTopic032: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-032 ResourceTestSnsTopic033: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-033 ResourceTestSnsTopic034: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-034 ResourceTestSnsTopic035: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-035 ResourceTestSnsTopic036: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-036 ResourceTestSnsTopic037: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-037 ResourceTestSnsTopic038: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-038 ResourceTestSnsTopic039: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-039 ResourceTestSnsTopic040: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-040 ResourceTestSnsTopic041: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-041 ResourceTestSnsTopic042: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-042 ResourceTestSnsTopic043: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-043 ResourceTestSnsTopic044: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-044 ResourceTestSnsTopic045: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-045 ResourceTestSnsTopic046: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-046 ResourceTestSnsTopic047: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-047 ResourceTestSnsTopic048: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-048 ResourceTestSnsTopic049: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-049 ResourceTestSnsTopic050: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-050 ResourceTestSnsTopic051: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-051 ResourceTestSnsTopic052: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-052 ResourceTestSnsTopic053: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-053 ResourceTestSnsTopic054: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-054 ResourceTestSnsTopic055: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-055 ResourceTestSnsTopic056: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-056 ResourceTestSnsTopic057: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-057 ResourceTestSnsTopic058: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-058 ResourceTestSnsTopic059: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-059 ResourceTestSnsTopic060: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-060 ResourceTestSnsTopic061: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-061 ResourceTestSnsTopic062: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-062 ResourceTestSnsTopic063: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-063 ResourceTestSnsTopic064: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-064 ResourceTestSnsTopic065: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-065 ResourceTestSnsTopic066: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-066 ResourceTestSnsTopic067: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-067 ResourceTestSnsTopic068: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-068 ResourceTestSnsTopic069: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-069 ResourceTestSnsTopic070: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-070 ResourceTestSnsTopic071: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-071 ResourceTestSnsTopic072: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-072 ResourceTestSnsTopic073: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-073 ResourceTestSnsTopic074: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-074 ResourceTestSnsTopic075: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-075 ResourceTestSnsTopic076: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-076 ResourceTestSnsTopic077: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-077 ResourceTestSnsTopic078: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-078 ResourceTestSnsTopic079: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-079 ResourceTestSnsTopic080: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-080 ResourceTestSnsTopic081: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-081 ResourceTestSnsTopic082: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-082 ResourceTestSnsTopic083: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-083 ResourceTestSnsTopic084: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-084 ResourceTestSnsTopic085: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-085 ResourceTestSnsTopic086: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-086 ResourceTestSnsTopic087: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-087 ResourceTestSnsTopic088: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-088 ResourceTestSnsTopic089: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-089 ResourceTestSnsTopic090: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-090 ResourceTestSnsTopic091: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-091 ResourceTestSnsTopic092: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-092 ResourceTestSnsTopic093: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-093 ResourceTestSnsTopic094: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-094 ResourceTestSnsTopic095: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-095 ResourceTestSnsTopic096: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-096 ResourceTestSnsTopic097: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-097 ResourceTestSnsTopic098: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-098 ResourceTestSnsTopic099: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-099 ResourceTestSnsTopic100: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-100 ResourceTestSnsTopic101: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-101 ResourceTestSnsTopic102: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-102 ResourceTestSnsTopic103: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-103 ResourceTestSnsTopic104: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-104 ResourceTestSnsTopic105: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-105 ResourceTestSnsTopic106: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-106 ResourceTestSnsTopic107: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-107 ResourceTestSnsTopic108: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-108 ResourceTestSnsTopic109: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-109 ResourceTestSnsTopic110: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-110 ResourceTestSnsTopic111: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-111 ResourceTestSnsTopic112: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-112 ResourceTestSnsTopic113: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-113 ResourceTestSnsTopic114: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-114 ResourceTestSnsTopic115: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-115 ResourceTestSnsTopic116: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-116 ResourceTestSnsTopic117: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-117 ResourceTestSnsTopic118: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-118 ResourceTestSnsTopic119: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-119 ResourceTestSnsTopic120: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-120 ResourceTestSnsTopic121: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-121 ResourceTestSnsTopic122: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-122 ResourceTestSnsTopic123: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-123 ResourceTestSnsTopic124: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-124 ResourceTestSnsTopic125: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-125 ResourceTestSnsTopic126: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-126 ResourceTestSnsTopic127: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-127 ResourceTestSnsTopic128: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-128 ResourceTestSnsTopic129: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-129 ResourceTestSnsTopic130: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-130 ResourceTestSnsTopic131: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-131 ResourceTestSnsTopic132: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-132 ResourceTestSnsTopic133: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-133 ResourceTestSnsTopic134: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-134 ResourceTestSnsTopic135: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-135 ResourceTestSnsTopic136: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-136 ResourceTestSnsTopic137: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-137 ResourceTestSnsTopic138: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-138 ResourceTestSnsTopic139: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-139 ResourceTestSnsTopic140: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-140 ResourceTestSnsTopic141: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-141 ResourceTestSnsTopic142: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-142 ResourceTestSnsTopic143: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-143 ResourceTestSnsTopic144: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-144 ResourceTestSnsTopic145: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-145 ResourceTestSnsTopic146: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-146 ResourceTestSnsTopic147: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-147 ResourceTestSnsTopic148: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-148 ResourceTestSnsTopic149: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-149 ResourceTestSnsTopic150: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-150 ResourceTestSnsTopic151: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-151 ResourceTestSnsTopic152: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-152 ResourceTestSnsTopic153: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-153 ResourceTestSnsTopic154: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-154 ResourceTestSnsTopic155: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-155 ResourceTestSnsTopic156: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-156 ResourceTestSnsTopic157: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-157 ResourceTestSnsTopic158: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-158 ResourceTestSnsTopic159: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-159 ResourceTestSnsTopic160: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-160 ResourceTestSnsTopic161: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-161 ResourceTestSnsTopic162: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-162 ResourceTestSnsTopic163: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-163 ResourceTestSnsTopic164: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-164 ResourceTestSnsTopic165: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-165 ResourceTestSnsTopic166: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-166 ResourceTestSnsTopic167: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-167 ResourceTestSnsTopic168: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-168 ResourceTestSnsTopic169: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-169 ResourceTestSnsTopic170: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-170 ResourceTestSnsTopic171: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-171 ResourceTestSnsTopic172: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-172 ResourceTestSnsTopic173: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-173 ResourceTestSnsTopic174: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-174 ResourceTestSnsTopic175: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-175 ResourceTestSnsTopic176: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-176 ResourceTestSnsTopic177: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-177 ResourceTestSnsTopic178: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-178 ResourceTestSnsTopic179: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-179 ResourceTestSnsTopic180: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-180 ResourceTestSnsTopic181: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-181 ResourceTestSnsTopic182: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-182 ResourceTestSnsTopic183: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-183 ResourceTestSnsTopic184: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-184 ResourceTestSnsTopic185: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-185 ResourceTestSnsTopic186: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-186 ResourceTestSnsTopic187: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-187 ResourceTestSnsTopic188: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-188 ResourceTestSnsTopic189: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-189 ResourceTestSnsTopic190: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-190 ResourceTestSnsTopic191: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-191 ResourceTestSnsTopic192: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-192 ResourceTestSnsTopic193: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-193 ResourceTestSnsTopic194: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-194 ResourceTestSnsTopic195: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-195 ResourceTestSnsTopic196: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-196
このファイルをデプロイします。
$ sam build $ sam package \ --output-template-file packaged.yaml \ --s3-bucket cm-fujii.genki-sam-test-bucket $ sam deploy \ --template-file packaged.yaml \ --stack-name Test-Resource-200-Stack \ --capabilities CAPABILITY_NAMED_IAM \ --no-fail-on-empty-changeset
リソース数は200ぴったりになりました。
既存のLambdaを削除して新しいLambdaをデプロイする
既存のLambda定義(論理名とスケジュール)を少し変更しました。これで既存のLambdaを削除して新しいLambdaを作ります。
変更前 | 変更後 |
---|---|
HelloWorldFunction | HelloWorldFunction2 |
cron(0 0 * * ? *) | cron(30 12 * * ? *) |
長いので折りたたみます
AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: test-resource-200 Resources: HelloWorldFunction2: Type: AWS::Serverless::Function Properties: CodeUri: hello_world/ Handler: app.lambda_handler Runtime: python3.7 Events: HelloWorld: Type: Schedule Properties: Schedule: cron(30 12 * * ? *) ResourceTestSnsTopic001: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-001 ResourceTestSnsTopic002: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-002 ResourceTestSnsTopic003: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-003 ResourceTestSnsTopic004: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-004 ResourceTestSnsTopic005: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-005 ResourceTestSnsTopic006: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-006 ResourceTestSnsTopic007: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-007 ResourceTestSnsTopic008: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-008 ResourceTestSnsTopic009: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-009 ResourceTestSnsTopic010: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-010 ResourceTestSnsTopic011: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-011 ResourceTestSnsTopic012: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-012 ResourceTestSnsTopic013: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-013 ResourceTestSnsTopic014: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-014 ResourceTestSnsTopic015: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-015 ResourceTestSnsTopic016: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-016 ResourceTestSnsTopic017: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-017 ResourceTestSnsTopic018: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-018 ResourceTestSnsTopic019: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-019 ResourceTestSnsTopic020: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-020 ResourceTestSnsTopic021: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-021 ResourceTestSnsTopic022: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-022 ResourceTestSnsTopic023: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-023 ResourceTestSnsTopic024: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-024 ResourceTestSnsTopic025: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-025 ResourceTestSnsTopic026: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-026 ResourceTestSnsTopic027: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-027 ResourceTestSnsTopic028: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-028 ResourceTestSnsTopic029: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-029 ResourceTestSnsTopic030: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-030 ResourceTestSnsTopic031: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-031 ResourceTestSnsTopic032: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-032 ResourceTestSnsTopic033: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-033 ResourceTestSnsTopic034: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-034 ResourceTestSnsTopic035: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-035 ResourceTestSnsTopic036: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-036 ResourceTestSnsTopic037: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-037 ResourceTestSnsTopic038: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-038 ResourceTestSnsTopic039: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-039 ResourceTestSnsTopic040: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-040 ResourceTestSnsTopic041: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-041 ResourceTestSnsTopic042: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-042 ResourceTestSnsTopic043: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-043 ResourceTestSnsTopic044: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-044 ResourceTestSnsTopic045: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-045 ResourceTestSnsTopic046: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-046 ResourceTestSnsTopic047: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-047 ResourceTestSnsTopic048: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-048 ResourceTestSnsTopic049: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-049 ResourceTestSnsTopic050: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-050 ResourceTestSnsTopic051: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-051 ResourceTestSnsTopic052: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-052 ResourceTestSnsTopic053: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-053 ResourceTestSnsTopic054: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-054 ResourceTestSnsTopic055: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-055 ResourceTestSnsTopic056: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-056 ResourceTestSnsTopic057: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-057 ResourceTestSnsTopic058: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-058 ResourceTestSnsTopic059: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-059 ResourceTestSnsTopic060: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-060 ResourceTestSnsTopic061: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-061 ResourceTestSnsTopic062: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-062 ResourceTestSnsTopic063: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-063 ResourceTestSnsTopic064: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-064 ResourceTestSnsTopic065: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-065 ResourceTestSnsTopic066: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-066 ResourceTestSnsTopic067: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-067 ResourceTestSnsTopic068: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-068 ResourceTestSnsTopic069: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-069 ResourceTestSnsTopic070: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-070 ResourceTestSnsTopic071: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-071 ResourceTestSnsTopic072: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-072 ResourceTestSnsTopic073: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-073 ResourceTestSnsTopic074: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-074 ResourceTestSnsTopic075: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-075 ResourceTestSnsTopic076: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-076 ResourceTestSnsTopic077: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-077 ResourceTestSnsTopic078: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-078 ResourceTestSnsTopic079: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-079 ResourceTestSnsTopic080: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-080 ResourceTestSnsTopic081: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-081 ResourceTestSnsTopic082: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-082 ResourceTestSnsTopic083: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-083 ResourceTestSnsTopic084: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-084 ResourceTestSnsTopic085: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-085 ResourceTestSnsTopic086: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-086 ResourceTestSnsTopic087: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-087 ResourceTestSnsTopic088: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-088 ResourceTestSnsTopic089: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-089 ResourceTestSnsTopic090: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-090 ResourceTestSnsTopic091: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-091 ResourceTestSnsTopic092: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-092 ResourceTestSnsTopic093: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-093 ResourceTestSnsTopic094: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-094 ResourceTestSnsTopic095: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-095 ResourceTestSnsTopic096: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-096 ResourceTestSnsTopic097: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-097 ResourceTestSnsTopic098: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-098 ResourceTestSnsTopic099: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-099 ResourceTestSnsTopic100: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-100 ResourceTestSnsTopic101: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-101 ResourceTestSnsTopic102: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-102 ResourceTestSnsTopic103: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-103 ResourceTestSnsTopic104: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-104 ResourceTestSnsTopic105: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-105 ResourceTestSnsTopic106: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-106 ResourceTestSnsTopic107: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-107 ResourceTestSnsTopic108: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-108 ResourceTestSnsTopic109: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-109 ResourceTestSnsTopic110: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-110 ResourceTestSnsTopic111: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-111 ResourceTestSnsTopic112: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-112 ResourceTestSnsTopic113: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-113 ResourceTestSnsTopic114: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-114 ResourceTestSnsTopic115: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-115 ResourceTestSnsTopic116: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-116 ResourceTestSnsTopic117: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-117 ResourceTestSnsTopic118: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-118 ResourceTestSnsTopic119: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-119 ResourceTestSnsTopic120: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-120 ResourceTestSnsTopic121: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-121 ResourceTestSnsTopic122: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-122 ResourceTestSnsTopic123: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-123 ResourceTestSnsTopic124: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-124 ResourceTestSnsTopic125: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-125 ResourceTestSnsTopic126: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-126 ResourceTestSnsTopic127: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-127 ResourceTestSnsTopic128: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-128 ResourceTestSnsTopic129: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-129 ResourceTestSnsTopic130: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-130 ResourceTestSnsTopic131: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-131 ResourceTestSnsTopic132: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-132 ResourceTestSnsTopic133: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-133 ResourceTestSnsTopic134: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-134 ResourceTestSnsTopic135: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-135 ResourceTestSnsTopic136: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-136 ResourceTestSnsTopic137: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-137 ResourceTestSnsTopic138: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-138 ResourceTestSnsTopic139: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-139 ResourceTestSnsTopic140: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-140 ResourceTestSnsTopic141: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-141 ResourceTestSnsTopic142: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-142 ResourceTestSnsTopic143: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-143 ResourceTestSnsTopic144: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-144 ResourceTestSnsTopic145: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-145 ResourceTestSnsTopic146: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-146 ResourceTestSnsTopic147: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-147 ResourceTestSnsTopic148: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-148 ResourceTestSnsTopic149: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-149 ResourceTestSnsTopic150: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-150 ResourceTestSnsTopic151: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-151 ResourceTestSnsTopic152: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-152 ResourceTestSnsTopic153: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-153 ResourceTestSnsTopic154: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-154 ResourceTestSnsTopic155: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-155 ResourceTestSnsTopic156: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-156 ResourceTestSnsTopic157: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-157 ResourceTestSnsTopic158: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-158 ResourceTestSnsTopic159: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-159 ResourceTestSnsTopic160: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-160 ResourceTestSnsTopic161: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-161 ResourceTestSnsTopic162: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-162 ResourceTestSnsTopic163: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-163 ResourceTestSnsTopic164: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-164 ResourceTestSnsTopic165: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-165 ResourceTestSnsTopic166: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-166 ResourceTestSnsTopic167: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-167 ResourceTestSnsTopic168: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-168 ResourceTestSnsTopic169: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-169 ResourceTestSnsTopic170: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-170 ResourceTestSnsTopic171: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-171 ResourceTestSnsTopic172: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-172 ResourceTestSnsTopic173: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-173 ResourceTestSnsTopic174: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-174 ResourceTestSnsTopic175: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-175 ResourceTestSnsTopic176: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-176 ResourceTestSnsTopic177: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-177 ResourceTestSnsTopic178: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-178 ResourceTestSnsTopic179: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-179 ResourceTestSnsTopic180: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-180 ResourceTestSnsTopic181: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-181 ResourceTestSnsTopic182: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-182 ResourceTestSnsTopic183: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-183 ResourceTestSnsTopic184: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-184 ResourceTestSnsTopic185: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-185 ResourceTestSnsTopic186: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-186 ResourceTestSnsTopic187: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-187 ResourceTestSnsTopic188: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-188 ResourceTestSnsTopic189: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-189 ResourceTestSnsTopic190: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-190 ResourceTestSnsTopic191: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-191 ResourceTestSnsTopic192: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-192 ResourceTestSnsTopic193: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-193 ResourceTestSnsTopic194: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-194 ResourceTestSnsTopic195: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-195 ResourceTestSnsTopic196: Type: AWS::SNS::Topic Properties: TopicName: resource-test-sns-topic-196
このファイルをデプロイします。
$ sam build $ sam package \ --output-template-file packaged.yaml \ --s3-bucket cm-fujii.genki-sam-test-bucket $ sam deploy \ --template-file packaged.yaml \ --stack-name Test-Resource-200-Stack \ --capabilities CAPABILITY_NAMED_IAM \ --no-fail-on-empty-changeset
デプロイは成功しました。リソース数は200です。
ちなみに、新しいLambdaはちゃんとデプロイされています。
おまけ
リソース数が200の状態でSNSトピックを1個追加してデプロイしたところ、予想通り失敗しました。
Waiting for changeset to be created.. Error: Failed to create changeset for the stack: Test-Resource-200-Stack, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Template format error: Number of resources, 201, is greater than maximum allowed, 200
さいごに
リソース数が200の状態でもデプロイできることが分かって安心しました。